<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
	<title>超级后台管理系统</title>
	<meta name="description" content="desc">
	<link href="#(prj)/assets/static/css/bootstrap.min.css" rel="stylesheet"/>
	<link href="#(prj)/assets/static/css/font-awesome.min.css" rel="stylesheet"/>
	<link href="#(prj)/assets/static/css/style.min.css" rel="stylesheet"/>
	<link href="#(prj)/assets/static/css/login.min.css" rel="stylesheet"/>
	<link href="#(prj)/assets/static/ruoyi/css/ry-ui.css" rel="stylesheet"/>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<!--<link rel="shortcut icon" href="#(prj)#(config.ico??)"/>-->
	<style type="text/css">
		.udfsignin {
			height: auto;
			background-color: #b8c7ce;
			/*background: url('#(prj)#(config.login_bg??)') no-repeat center fixed;*/
			-webkit-background-size: cover;
			-moz-background-size: cover;
			-o-background-size: cover;
			background-size: cover;
		}
	</style>
</head>
<body class="udfsignin">
<div class="signinpanel">
	<div class="row">
		<div class="col-sm-3">
		</div>
		<div class="col-sm-6">
			<div class="signin-info">
				<div class="m-b"></div>
				<h1 style="font-size: 20px">欢迎进入 <strong> 超级后台管理系统</strong></h1>
			</div>
			<form id="sublogin">
				<h4 class="no-margins" style="font-size: 18px">账户密码登录：</h4>
				<input type="text" name="username" class="form-control uname" placeholder="用户名"/>
				<input type="password" name="password" class="form-control pword" placeholder="密码"/>
				<div class="row m-t">
					<div class="col-xs-6">
						<input type="text" name="code" class="form-control code" placeholder="验证码"
							   maxlength="5"/>
					</div>
					<div class="col-xs-6">
						<a href="javascript:void(0);" title="点击更换验证码">
							<img src="#(prj)/admin/login/captcha" id="imgcode" class="imgcode" width="85%"/>
						</a>
					</div>
				</div>
				<a class="btn btn-success btn-block" id="sub" data-loading="正在验证登录，请稍后...">登录</a>
			</form>
		</div>
	</div>
	<div class="signup-footer" style="margin-top: 250px">
		<div class="pull-left">
			#(config.copyright??) <br>
		</div>
	</div>
</div>

<script src="#(prj)/assets/static/js/jquery.min.js"></script>
<script src="#(prj)/assets/static/ajax/libs/validate/jquery.validate.min.js"></script>
<script src="#(prj)/assets/static/ajax/libs/layer/layer.min.js"></script>
<script src="#(prj)/assets/static/ajax/libs/blockUI/jquery.blockUI.js"></script>
<script src="#(prj)/assets/static/ruoyi/js/ry-ui.js"></script>
<script src="#(prj)/assets/static/js/tripledes.js"></script>
<script src="#(prj)/assets/static/js/mode-ecb.js"></script>
<script src="#(prj)/assets/static/js/desUtil.js"></script>
<script src="#(prj)/assets/static/js/base.js"></script>
<script src="#(prj)/assets/static/js/jsencrypt.min.js"></script>

<script>



    $("#sub").click(function () {
        login();
    })

    $("input[name=username],input[name=password],input[name=code]").keyup(function(event){
        if(event.keyCode ==13){
            login();
        }
    });


    $("#imgcode").click(function () {
        vercodeChange();
    })

    function vercodeChange() {
        $("#imgcode").attr("src","#(prj)/super-admin/login/captcha?t="+new Date().getTime());
    }
    //登录
    function login(){
        var username = $("input[name=username]").val();
        var password = $("input[name=password]").val();
        var code = $("input[name=code]").val();


        if(username == null || username == ''){
            $.modal.msgError("请输入用户名")
            return false;
        }
        if(password == null || password == ''){
            $.modal.msgError("请输入密码")
            return false;
        }
        if(code == null || code == ''){
            $.modal.msgError("请输入验证码")
            return false;
        }

        $.ajax(
            {
                url: "#(prj)/super-admin/login/doLogin",
                type: "post",
                dataType: "json",
                data: $('#sublogin').serialize(),
/*                data: {
                    "username":username,
                    "password":password,
                    "code":code
                },*/
                beforeSend: function () {
                    $.modal.loading("正在处理中，请稍后...");
                },
                success: function(result) {
                    if (result.state == 'ok') {
                        location.href = "#(prj)/super-admin"
                    } else {
                        $.modal.alertError(result.msg);
                        vercodeChange();
                        $.modal.closeLoading();
                    }
                }
            }
        )
    }



</script>
</body>
</html>
